package cz.proks.schoolpupilbook.gae.dbo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import com.google.appengine.api.datastore.Key;

import cz.proks.schoolpupilbook.shared.domain.User.Role;

@Entity
public class UserDBO implements IsIndexableDBO{
	private Key id;
	private String name;
	private String surname;
	private String username;
	private String password;
	private Role userRole;	
	
	public UserDBO() {
		// TODO Auto-generated constructor stub
	}
		
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)	
	public Key getId() {
		return id;
	}
	public void setId(Key id) {
		this.id = id;
	}
	
	@Basic
	@Column(nullable=false)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Basic
	@Column(nullable=false)
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		this.surname = surname;
	}
	@Basic	
	@Column(nullable=false)
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	@Basic
	@Column(nullable=false)
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@Enumerated(EnumType.STRING)
	@Column(nullable=false)
	public Role getUserRole() {
		return userRole;
	}
	public void setUserRole(Role userRole) {
		this.userRole = userRole;
	}		
}
 